package com.mapper;

import com.pojo.Sstudent;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
* @author 27761
* @description 针对表【sstudent】的数据库操作Mapper
* @createDate 2024-11-19 18:52:28
* @Entity com.pojo.Sstudent
*/
public interface SstudentMapper {

    int deleteByPrimaryKey(Long id);

    int insert(Sstudent record);

    int insertSelective(Sstudent record);

    Sstudent selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Sstudent record);

    int updateByPrimaryKey(Sstudent record);

    @Select("select * from sstudent where id=#{id}")
    Sstudent selectSstudent(int id);

    @Update("update sstudent set name=#{name},age=#{age}  where id =#{id}")
    int updateSstudent(Sstudent sstudent);

    @Select("select * from sstudent where cid=#{id}")
    @Results({
            @Result(id=true,column = "id",property = "id"),
            @Result(column = "name",property = "name"),
            @Result(column = "age",property = "age")
    })
    List<Sstudent> selectSstudentByCclassId(int cclass_id);
}
